<?php
include_once("../modules/checkA.php");
include_once("../../config.php"); 
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'finance'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-list-function.php"); 
?>




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>
</head>

<body>
 



 
<?php

//传递过来的页面信息。返回的时候，会根据这些信息返回原来的页面
$nowpageid      = addslashes($_REQUEST['nowpageid']);
$sortby         = addslashes($_REQUEST['sortby']);
$term_nid       = addslashes($_REQUEST['term_nid']);
?>


<?

$new_name         = addslashes($_REQUEST['name']);
$new_principal         = addslashes($_REQUEST['principal']);
$new_departmentid = addslashes($_REQUEST['departmentid']);
$new_cost         = addslashes($_REQUEST['cost']);
$new_status       = addslashes($_REQUEST['status']);
$new_applydate    = addslashes($_REQUEST['applydate']);
$new_classify     = addslashes($_REQUEST['classify']);
$new_remark       = addslashes($_REQUEST['remark']);
$new_masterid       = addslashes($_REQUEST['masterid']);

$ip               = $_SERVER["REMOTE_ADDR"];
$new_authur       = $_SESSION['nid'];

//财务数据，修改数据的源数据id
$new_rid       = addslashes($_REQUEST['nid']);




//设置需要搜索的表格的前缀后缀
$table_Suffix = "finance";
$table        = $table_Prefix . $table_Suffix;
//设置需要搜索的表格的前缀后缀



$sql = "INSERT INTO $table (
name,
principal,
departmentid,
cost,
status,
applydate,
classify,
authur,
ip,
rid,
masterid,
applystatus,
remark
)

value (
'$new_name',
'$new_principal',
'$new_departmentid',
'$new_cost',
'$new_status',
'$new_applydate',
'$new_classify',
'$new_authur',
'$ip',
'$new_rid',
'$masterid',
'申请修改',
'$new_remark'
)";






//加一道防御，如果缺少必要信息，就不能添加信息上去哦
if($_SESSION['username'])
{
$query = mysql_query($sql) or die ('添加报名信息失败！');

//如果从未收款变成已收款的话，需要在审核的时候才更改这个时候不能处理。
//if($_REQUEST['status']=="已收款")
//{
//$query2 = mysql_query($sql_finance) or die ('添加财务信息失败！');
//}

}
else
{
    echo "请登录后进行操作";
}

mysql_close($con);

 
?>

<!---->
<?//if($new_status=="已收款"){?>
<!--    <script type="text/javascript">-->
<!--        alert("输入信息已保存，点击确认打印收据.");-->
<!--        window.open("receipt.php?nav-itemed=member&nid=102');-->
<!--    </script>-->
<?//}else{?>
<!--    <script type="text/javascript">
        alert("输入信息已保存，点击确认返回继续操作.");
        document.location.href = "detail-list.php?nav-itemed=finance";
    </script>-->
<?//}?>
<!---->


</body>

<?

$nowpageid = $_GET["nowpageid"];
if($nowpageid==1){
    $url = "detail-list.php?nav-itemed=finance";
}
else{
    $url = "detail-list.php?nowpageid=".$nowpageid."&sortby=nid&nid=&sys_part=finance&nav-itemed=finance";
}
?>



<script type="text/javascript">
    alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "<?echo $url?>";

</script>